//写所有的后台接口，做到 后台接口统一管理
import request from '../utils/request.js'

//1. 设备概览接口
export const $deviceCount = ()=>{
    return request.get("/device/count");
}

//2. 传感器 接口
export const $sensorCount = ()=>{
    return request.get("/sensor/count");
}

//3. 传感器
export const $sensorList = ()=>{
    return request.get("/device/sensorList");
}

//4. 设备网关列表
export const $gatewayList = (data)=>{
    return request.get("/gateway/list",{
        params:data
    });
}

//5. 节点群组列表
export const $getGroupList = ()=>{
    return request.get("/group/list");
}

//6. 根据id查列表
export const $getGroupByID = (id)=>{
    return request.get("/group/detail",{
        params:{
            id
        }
    });
}

//7. 新增群组
export const $addGroup = (name)=>{
    return request.post("/group/add",{
        params:{
            groupName:name
        }
    })
}

//8. 重命名群组名称
export const $rename = (id,groupName)=>{
    return request.post("/group/edit",{
        params:{
            id,groupName
        }
    })
}

//9. 删除群组
export const $delGroup = (id)=>{
    return request.post("/group/del",{
        params:{
            id
        }
    })
}

//10. 传感器列表
export const $getSensorList = (params)=>{
    return request.get("/sensor/list",{
        params
    })
}

//11. 登录
export const $login = params =>{
    return request.post("/account/login",
        params)
}


//12. 注册
export const $register = params =>{
    return request.get("/account/add",{
        params
    })
}

//13. 使用记录
export const $usageList = params =>{
    return request.get("/fee/usageList",{
        params
    })
}

//14. 充值记录
export const $rechargeList = params =>{
    return request.get("/fee/rechargeList",{
        params
    })
}

//15. 子账号列表
export const $accountList = params =>{
    return request.get("/account/list",{
        params
    })
}



